package win.zxshuo.www.controller;

import java.util.List;

public class PagerData<E> {
    private Long currentPage;

    private Long totalPage;

    private Long totalItemNumber;

    private Long size;

    private List<E> data;



    public Long getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(Long currentPage) {
        this.currentPage = currentPage;
    }

    public Long getTotalPage() {
        return totalPage;
    }

    public void setTotalPage() {
        Long thePage = totalItemNumber / size;
        Long left = totalItemNumber % size;
        if (!left.equals(0)){
            thePage = thePage+1;
        }
        this.totalPage = thePage;
    }

    public Long getTotalItemNumber() {
        return totalItemNumber;
    }

    public void setTotalItemNumber(Long totalItemNumber) {
        this.totalItemNumber = totalItemNumber;
    }

    public Long getSize() {
        return size;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public List<E> getData() {
        return data;
    }

    public void setData(List<E> data) {
        this.data = data;
    }
}
